<?php

 include("dbconnect.php");
 ?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<title>Documento sin t&iacute;tulo</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link media="screen, projection" type="text/css" href="Estilos_admin.css" rel="stylesheet">
<link media="screen, projection" type="text/css" href="Estilos_css.css" rel="stylesheet">
<script language="JavaScript" src="admin_scripts.js" type="text/javascript"></script>
</head>

<body onload="SendForm3('carga');">

<?php
echo "<div style=\"visibility:hidden\">";

$sql="SELECT 
			A.ID_ENTRADA, A.TITULO, B.ID_CATEGORIA, A.DESCRIPCION, D.TEXTO
		FROM 
			ENTRADAS A,
			CATEGORIAS B,
			CAT_ENTRADAS C,
			ENTRADA_TEXTO D,
			SUBCATEGORIAS E
		WHERE 
			 A.ID_ENTRADA=".$_GET['ent']." AND
			 A.ID_ENTRADA=C.ID_ENTRADA AND
			 C.ID_SUBCATEGORIA=E.ID_SUBCATEGORIA AND
			 E.ID_CATEGORIA=B.ID_CATEGORIA AND
			 A.ID_ENTRADA=D.ID_ENTRADA
		ORDER BY A.ID_ENTRADA DESC";
$result=mysql_query($sql);
list($id_entrada,$titulo,$id_categoria,$descripcion,$texto)=mysql_fetch_row($result);

echo "<form id=\"setEntrada\" method=\"post\" action=\"Admin_main.php?opt=4&ent=".$_GET['ent']."\">";

echo "<input id=\"titulo\" type=\"text\" name=\"titulo\" value=\"".$titulo."\">";
	
echo "<input id=\"categoria\" type=\"text\" name=\"categoria\" value=\"".$id_categoria."\">";

<<<<<<< .mine
echo "<textarea name=\"descripcion\">".$descripcion."</textarea>";
=======
echo "<textarea name=\"descripcion\">".str_replace('\"','"',$descripcion)."</textarea>";
>>>>>>> .r84

echo "<textarea name=\"texto\">".$texto."</textarea>";
	
echo "<select id=\"subcategoria\" name=\"subcategoria[]\">";
$sql="SELECT ID_SUBCATEGORIA FROM CAT_ENTRADAS WHERE ID_ENTRADA=$id_entrada";
$result=mysql_query($sql);
while(list($subcategorias)=mysql_fetch_row($result)){
	$sql="SELECT SUBCATEGORIA FROM SUBCATEGORIAS WHERE ID_SUBCATEGORIA=".$subcategorias;
	$result=mysql_query($sql);
	list($subcategoria)=mysql_fetch_row($result);
	echo "<option value=\"$subcategorias\">".$subcategoria."</option></select>";
}
echo "</select>";

echo "<select id=\"tags\" name=\"tags[]\">";
$sql="SELECT ID_TAG FROM ENTRADA_TAG WHERE ID_ENTRADA=$id_entrada";
$result=mysql_query($sql);
while(list($tags)=mysql_fetch_row($result)){
	$sql="SELECT TAG FROM TAGS WHERE ID_TAG=".$tags;
	$result=mysql_query($sql);
	list($tag)=mysql_fetch_row($result);
	echo "<option value=\"$tags\">".$tag."</option></select>";
}
echo "</select>";
	
echo "<input name=\"accion\" type=\"hidden\" value=\"carga\" />";

echo "</form>";

echo "</div>";
?>

</body>
</html>
